package com.imu.enums;

/**
 * 付款 状态
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2017-12-28 20:34:20
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public enum PStatus 
{
	Create(0, "处理中"), 				//待支付, 支付中
	Finished(1, "成功"),			//支付成功
	Cancel(-1, "失败");				//支付失败

	private int type;
	private String desc;

	private PStatus(int type, String desc) {
		this.type = type;
		this.desc = desc;
	}

	public int getType() {
		return this.type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public String getDesc() {
		return this.desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static String getByType(int type)
	{
		for (PStatus e : PStatus.values()) {
			if(e.getType() == type) return e.getDesc();
		}
		
		return String.valueOf(type);
	}
}